package cn.edu.scau.cmi.huxiantao.simpleFactory;

import cn.edu.scau.cmi.huxiantao.domain.BodyInjury;
import cn.edu.scau.cmi.huxiantao.domain.CarInjury;
import cn.edu.scau.cmi.huxiantao.domain.Injury;
import cn.edu.scau.cmi.huxiantao.domain.ManInjury;
import cn.edu.scau.cmi.huxiantao.domain.MultInjury;

public class InsuranceFactory {
	public static Injury getInstance(String type) {
		Injury injury=null;
		if(type.equals("BodyInjury")) {
			injury=new BodyInjury();
		}else if(type.equals("CarInjury")) {
			injury=new CarInjury();
		}else if(type.equals("ManInjury")) {
			injury=new ManInjury();
		}else if(type.equals("MultInjury")) {
			injury=new MultInjury();
		}
		return injury;
	}
}
